package com.example.demo.listener.event;

import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

/**
 * 自定义事件监听--启动监听器
 * Created by lisen on 2017/7/4.
 */
public class MyApplicationStartedEventListener implements ApplicationListener<ApplicationStartedEvent> {
    private Logger log = Logger.getLogger(MyApplicationStartedEventListener.class);

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        SpringApplication app = event.getSpringApplication();
        app.setShowBanner(false); // 不显示banner信息
        System.out.println("==MyApplicationStartedEventListener====================================");
    }
}
